<% @posts.each do |post| %>
  $("#post-list").append("<%=j render :partial => "post", :locals => { :post => post } %>");
<% end %>

<% if @posts.any? %>
var current_post_id = <%= @posts.last.id %>;
<% end %>
